package demo2;

abstract class BattleField1{
    String Corps = "突击兵";//抽象出来 兵种
    String Arms;//抽象出来 武器
    public BattleField1(String s,String t){               //父类的构造方法
        System.out.println("装备着" + t + "的" + s + "已部署");
    }
}
interface IRunning{
    public abstract void Running();
}
interface IAttack{
    public abstract void Attack();
}
interface IHealthy{
    public abstract void Healthy();
}
interface IDriving{
    public abstract void Driving();
}
class Assult extends BattleField1 implements IAttack,IDriving,IHealthy,IRunning{
    public Assult(String s, String t) {
        super(s, t);
    }

    @Override
    public void Running() {
        System.out.println(Corps + "正在突击！！！");
    }

    @Override
    public void Attack() {
        System.out.println(Corps + "正在进攻！！！");
    }

    @Override
    public void Healthy() {
        System.out.println(Corps + "血量健康");
    }

    @Override
    public void Driving() {
        this.Corps = "Pro";
        System.out.println(Corps + "抢到了战争巨兽！！！");

    }
}
public class Interfacee {
    public static void Run(IRunning iRunning){
        iRunning.Running();
    }
    public static void Drive(IDriving driving){
        driving.Driving();
    }
    public static void main(String[] args) {
        Run(new Assult("突击兵","M1917"));//接口的使用只能通过”调用了接口的方法“来实现吗？
        Drive(new Assult("支援兵","扳手"));
    }
}
